fix: crash when searching users on participants step#91504
Open
rohit9625 wants to merge 8 commits into
Open
Conversation
Enhances `optionsOrderBy` and `optionsOrderAndGroupBy` to return a `hasMore` boolean, indicating if there were more items than the requested limit.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
QichenZhu
suggested changes
May 25, 2026
Contributor
|
@rohit9625 thanks! It works in my testing. Please go ahead with the unit tests and mark this as open when ready. |
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Contributor
Author
|
Hi @QichenZhu, the PR is now ready for final review :) |
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-05-29.at.1.23.09.AM.movScreen.Recording.2026-05-29.at.1.25.46.AM.movAndroid: mWeb ChromeScreen.Recording.2026-05-29.at.1.29.04.AM.movScreen.Recording.2026-05-29.at.1.30.37.AM.moviOS: HybridAppSimulator.Screen.Recording.-.iPhone.17.-.2026-05-29.at.01.23.05.movSimulator.Screen.Recording.-.iPhone.17.-.2026-05-29.at.01.24.52.moviOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.17.-.2026-05-29.at.01.28.03.movSimulator.Screen.Recording.-.iPhone.17.-.2026-05-29.at.01.30.27.movMacOS: Chrome / SafariScreen.Recording.2026-05-29.at.1.31.02.AM.movScreen.Recording.2026-05-29.at.1.35.29.AM.mov |
Contributor
@rohit9625 I think step 4 should reference step 3 here?
Should step 5 reference step 4? |
QichenZhu
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
This is the 2nd PR fixing the linked issue, as the first one caused a regression.
Previously, we added a guard to stop increasing
maxResultsonce all visible options had already been loaded. The implementation relied on counting the lengths of the rendered option groups (recentReports,personalDetails,workspaceChats, etc.) before callingsetMaxResults().However, this approach was not fully reliable because the visible option counts do not always reflect whether more results actually exist. In particular, the
selfDMChatlogic dynamically reduces the number ofpersonalDetailsslots, causing incorrecthasMorecalculations and resulting in a regression where additional results were not loaded correctly. More details in this comment.This change replaces the rendered-options counting approach with a more reliable solution by updating
optionsOrderByandoptionsOrderAndGroupByto explicitly return ahasMoreflag whenever heap truncation occurs.getValidOptions()now uses this source of truth to determine whether more matching results are available before increasingmaxResults, preventing unnecessary state updates and avoiding the infiniteonEndReachedloop.Fixed Issues
$ #90533
PROPOSAL: $ #90533 (comment)
Tests
Offline tests
Note: For reliable reproduction of the crash, please refer to my proposal before testing this PR.
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-05-28.at.11.02.45.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-05-28.at.10.59.07.AM.mov
iOS: Native
Screen.Recording.2026-05-28.at.10.13.39.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-05-28.at.10.22.54.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-28.at.11.04.23.AM.mov